package com.xjrsoft.module.customer.erp_model.eRP_PurchaseReceiptInfo.vo;

import java.time.LocalDateTime;

import com.fasterxml.jackson.annotation.JsonProperty;
import dm.jdbc.util.StringUtil;
import lombok.Data;
import com.xjrsoft.common.Enum.TransDataType;
import com.xjrsoft.common.annotation.DataTrans;
import io.swagger.annotations.ApiModel;

/**
 * 视图实体类
 *
 * @author pp
 * @since 2021-09-24
 */
@Data
@ApiModel(value = "列表ErpPurchasereceiptVo对象", description = "列表ErpPurchasereceiptVo对象")
public class ErpPurchasereceiptListVo {

    @JsonProperty("F_Id")
    private String fId;

    @JsonProperty("F_ReceiptNumber")
    private String fReceiptnumber;


    @JsonProperty("F_ReceiptDate")
    private LocalDateTime fReceiptdate;

    @JsonProperty("F_PurchasePeople")
    private String fPurchasepeople;

    @JsonProperty("F_PurOrderNumber")
    @DataTrans(dataType = TransDataType.DATA_SQL, dataCode = "localDB", sql = "select p.F_Id,p.F_PurchaseOrder,F_DeliveryUnit from erp_purchaseorder p", savedField = "F_Id", showField = "F_PurchaseOrder", multi = false)
    private String fPurordernumber;

    @JsonProperty("F_DeliveryUnit")
    @DataTrans(dataType = TransDataType.DATA_SQL, dataCode = "localDB", sql = "select i.F_Id,F_FullName from erp_inoutunit i where i.F_UniType=1", savedField = "F_Id", showField = "F_FullName", multi = false)
    private String fDeliveryunit;

    @JsonProperty("F_DefaultWarehouse")
    @DataTrans(dataType = TransDataType.DATA_SQL, dataCode = "localDB", sql = "SELECT W.F_Id,W.F_FullName FROM erp_warehouse W", savedField = "F_Id", showField = "F_FullName", multi = false)
    private String fDefaultwarehouse;

    @JsonProperty("F_Description")
    private String fDescription;

    @JsonProperty("F_CreatorUserId")
    @DataTrans(dataType = TransDataType.USER, multi = false)
    private String fCreatoruserid;

    @JsonProperty("F_CreatorTime")
    private LocalDateTime fCreatortime;

    //返回的值
    @JsonProperty("F_InvalidMark")
    private String fInvalidmarkName;
    public String getfInvalidmarkName() {
        String statusName = null;
        if (!StringUtil.isEmpty(this.fInvalidmarkName)) {
            switch (this.fInvalidmarkName) {
                case "1":
                    statusName = "正常";
                    break;
                case "2":
                    statusName = "作废";
                    break;
            }
        }
        return statusName;
    }

    @JsonProperty("F_AuditMark")
    private String fAuditMark;
    //转换方法
    public String getfAuditMark() {
        String name = null;
       if(!StringUtil.isEmpty(this.fAuditMark)){
           switch (this.fAuditMark) {
               case "1" :
                   name = "待审核";
                   break;
               case "2":
                   name = "审核通过";
                   break;
           }
       }
        return name;
    }
    @JsonProperty("flowStatus")
    private String flowStatus;

    @JsonProperty("nwfSchemeinfoId")
    private String nwfSchemeinfoId;

    @JsonProperty("formId")
    private String formId;
}
